package cn.itcast.hotel.controller;

import cn.itcast.hotel.pojo.PageResult;
import cn.itcast.hotel.pojo.ResquestParams;
import cn.itcast.hotel.service.IHotelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/hotel")
public class HotelController {

    @Autowired
    private IHotelService iHotelService;

    @PostMapping("list")
    public PageResult list(@RequestBody ResquestParams params) {
        return iHotelService.list(params);
    }

    @PostMapping("/filters")
    public Map<String, List<String>> filters(@RequestParam ResquestParams params) {
        return iHotelService.filters(params);
    }

}
